package com.ruoyi.school.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.school.mapper.BuildingMapper;
import com.ruoyi.school.domain.Building;
import com.ruoyi.school.service.IBuildingService;

/**
 * 楼宇管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-23
 */
@Service
public class BuildingServiceImpl implements IBuildingService 
{
    @Autowired
    private BuildingMapper buildingMapper;

    /**
     * 查询楼宇管理
     * 
     * @param id 楼宇管理主键
     * @return 楼宇管理
     */
    @Override
    public Building selectBuildingById(Long id)
    {
        return buildingMapper.selectBuildingById(id);
    }

    /**
     * 查询楼宇管理列表
     * 
     * @param building 楼宇管理
     * @return 楼宇管理
     */
    @Override
    public List<Building> selectBuildingList(Building building)
    {
        return buildingMapper.selectBuildingList(building);
    }

    /**
     * 新增楼宇管理
     * 
     * @param building 楼宇管理
     * @return 结果
     */
    @Override
    public int insertBuilding(Building building)
    {
        building.setCreateTime(DateUtils.getNowDate());
        return buildingMapper.insertBuilding(building);
    }

    /**
     * 修改楼宇管理
     * 
     * @param building 楼宇管理
     * @return 结果
     */
    @Override
    public int updateBuilding(Building building)
    {
        building.setUpdateTime(DateUtils.getNowDate());
        return buildingMapper.updateBuilding(building);
    }

    /**
     * 批量删除楼宇管理
     * 
     * @param ids 需要删除的楼宇管理主键
     * @return 结果
     */
    @Override
    public int deleteBuildingByIds(Long[] ids)
    {
        return buildingMapper.deleteBuildingByIds(ids);
    }

    /**
     * 删除楼宇管理信息
     * 
     * @param id 楼宇管理主键
     * @return 结果
     */
    @Override
    public int deleteBuildingById(Long id)
    {
        return buildingMapper.deleteBuildingById(id);
    }
}
